home *** CD-ROM | disk | FTP | other *** search
/ Amiga Collections: Camelot / Camelot 088 (1990-11)(Swedish User Group of Amiga)(SE)(PD)[WB].zip / Camelot 088 (1990-11)(Swedish User Group of Amiga)(SE)(PD)[WB].adf / Border / Border.c < prev    next >
C/C++ Source or Header  |  1990-10-13  |  2KB  |  69 lines

  1. /*=================================================================*/
  2. /*===== globals ===================================================*/
  3. /*=================================================================*/
  4. struct IntuitionBase *IntuitionBase;
  5. struct GfxBase *GfxBase;
  6. struct RastPort *rp;
  7. struct ViewPort *vp;
  8. struct Screen *scrn;
  9. struct ColorMap *cm;
  10. struct TagItem MyTag[] = {
  11.     { VTAG_BORDERBLANK_CLR, TRUE },
  12.     { TAG_DONE, NULL}
  13. };
  14.  
  15. void myWrite(UBYTE *string)
  16. {
  17.     Write(Output(), string, strlen(string));
  18. }
  19.  
  20. void main(UWORD argc, UBYTE *argv[])
  21. {
  22.   struct ExecBase *eb = *((struct ExecBase **)4L);
  23.  
  24.  
  25.     myWrite("\23333;1m_Border_\2330m Version 1.0\nCopyright © 1990 Synthetic Technologies\n\n");
  26.  
  27.     if(!(eb->LibNode.lib_Version < 36))
  28.         {
  29.         if(argc==2 && (argv[1][0] != '?'))
  30.             {
  31.             if(argv[1][1]=='f'||argv[1][1]=='F')
  32.                 {
  33.                 MyTag[0].ti_Tag=VTAG_BORDERBLANK_SET;
  34.                 }
  35.             if(IntuitionBase = (struct IntuitionBase *)OpenLibrary("intuition.library", 36L))
  36.                 {
  37.                 if(GfxBase = (struct GfxBase *)OpenLibrary("graphics.library", 36L))
  38.                     {
  39.                     if(GfxBase->ChipRevBits0 & GFXF_HR_DENISE)
  40.                         {
  41.                         if(scrn=LockPubScreen("Workbench"))
  42.                             {    
  43.                             cm=scrn->ViewPort.ColorMap;
  44.                             VideoControl(cm,MyTag);
  45.                             MakeScreen(scrn);
  46.                             RethinkDisplay();
  47.                             UnlockPubScreen(NULL,scrn);
  48.                             }
  49.                         }
  50.                     else
  51.                         {
  52.                         myWrite("You must have a Super Denise\n\n");
  53.                         }
  54.                     CloseLibrary((struct Library *)GfxBase);
  55.                     }
  56.                 CloseLibrary((struct Library *)IntuitionBase);
  57.                 }
  58.             }
  59.         else
  60.             {
  61.             myWrite("Usage: border <on|off>\n\n");
  62.             }
  63.         }
  64.     else
  65.         {
  66.         myWrite("Requires AmigaOS Release 2.0 or higher\n");
  67.         }
  68. }
  69.